/*     */ package com.umeng.newxp.view;
/*     */ 
/*     */ import android.content.Context;
/*     */ import android.content.res.Configuration;
/*     */ import android.content.res.Resources;
/*     */ import android.graphics.drawable.Drawable;
/*     */ import android.text.TextUtils;
/*     */ import android.util.AttributeSet;
/*     */ import android.view.LayoutInflater;
/*     */ import android.view.View;
/*     */ import android.widget.Button;
/*     */ import android.widget.ImageView;
/*     */ import android.widget.RelativeLayout;
/*     */ import android.widget.TextView;
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.common.c;
/*     */ import com.umeng.common.net.q;
/*     */ import com.umeng.common.net.q.a;
/*     */ import com.umeng.newxp.Promoter;
/*     */ import com.umeng.newxp.common.ExchangeConstants;
/*     */ import com.umeng.newxp.controller.ExchangeDataService;
/*     */ import com.umeng.newxp.net.XpReportClient;
/*     */ import com.umeng.newxp.net.e;
/*     */ import com.umeng.newxp.net.e.a;
/*     */ 
/*     */ public class P extends RelativeLayout
/*     */   implements aE, av
/*     */ {
/*     */   Promoter a;
/*  31 */   private boolean b = false;
/*     */   private q.a c;
/*     */   private LayoutInflater d;
/*     */   private ExchangeDataService e;
/*     */   private Drawable f;
/*     */ 
/*     */   public P(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
/*     */   {
/*  39 */     super(paramContext, paramAttributeSet, paramInt);
/*     */   }
/*     */ 
/*     */   public P(Context paramContext, AttributeSet paramAttributeSet) {
/*  43 */     super(paramContext, paramAttributeSet);
/*     */   }
/*     */ 
/*     */   public P(Context paramContext) {
/*  47 */     super(paramContext);
/*     */   }
/*     */ 
/*     */   public boolean a(ExchangeDataService paramExchangeDataService, Promoter paramPromoter, q.a parama) {
/*  51 */     if ((paramPromoter != null) && (!TextUtils.isEmpty(paramPromoter.img))) {
/*  52 */       this.a = paramPromoter;
/*  53 */       this.c = parama;
/*  54 */       this.e = paramExchangeDataService;
/*  55 */       this.d = ((LayoutInflater)getContext().getSystemService(
/*  56 */         "layout_inflater"));
/*  57 */       return true;
/*     */     }
/*  59 */     Log.b(ExchangeConstants.LOG_TAG, "promoter has no img url...");
/*  60 */     return false;
/*     */   }
/*     */ 
/*     */   public boolean a()
/*     */   {
/*  65 */     if (this.a == null) {
/*  66 */       Log.b(ExchangeConstants.LOG_TAG, "FImageView has no promoter..");
/*  67 */       return false;
/*     */     }
/*  69 */     c localc = c.a(getContext());
/*  70 */     if (getChildCount() > 0) {
/*  71 */       removeAllViews();
/*     */     }
/*  73 */     View localView = null;
/*  74 */     if (getContext().getResources().getConfiguration().orientation == 2)
/*  75 */       localView = this.d
/*  76 */         .inflate(localc.e("umeng_xp_fimageview_landscape"), this, false);
/*     */     else {
/*  78 */       localView = this.d.inflate(localc.e("umeng_xp_fimageview_portrait"), this, false);
/*     */     }
/*  80 */     ImageView localImageView = (ImageView)localView.findViewById(localc.c("umeng_xp_imagev"));
/*  81 */     TextView localTextView1 = (TextView)localView.findViewById(localc.c("umeng_xp_title"));
/*  82 */     TextView localTextView2 = (TextView)localView.findViewById(localc.c("umeng_xp_descript"));
/*     */ 
/*  84 */     Button localButton = (Button)localView.findViewById(localc.c("umeng_xp_button"));
/*     */ 
/*  86 */     Q localQ = new Q(this);
/*     */ 
/*  93 */     localButton.setOnClickListener(localQ);
/*  94 */     localTextView1.setText(this.a.title);
/*  95 */     localTextView2.setText(this.a.ad_words);
/*     */ 
/*  97 */     localImageView.setOnClickListener(localQ);
/*     */ 
/*  99 */     if (this.f == null) {
/* 100 */       q.a(getContext(), localImageView, this.a.img, false, 
/* 101 */         new R(this, localImageView));
/*     */     }
/*     */     else
/*     */     {
/* 120 */       localImageView.setImageDrawable(this.f);
/*     */     }
/*     */ 
/* 123 */     addView(localView, -1, -1);
/* 124 */     return true;
/*     */   }
/*     */ 
/*     */   public void a(int paramInt)
/*     */   {
/* 130 */     a();
/*     */   }
/*     */ 
/*     */   public void b()
/*     */   {
/* 135 */     e locale = new e.a(getContext())
/* 136 */       .a(0).b(0)
/* 137 */       .d(3).c(this.e.layoutType).a(new Promoter[] { this.a })
/* 138 */       .a(this.e.slot_id).d(this.e.getTimeConsuming())
/* 139 */       .c(this.e.sessionId).a();
/* 140 */     new XpReportClient(getContext()).sendAsync(locale, null);
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.newxp.view.P
 * JD-Core Version:    0.6.2
 */